package com.soecode.lyf.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.soecode.lyf.dao.PersonDao;
import com.soecode.lyf.entity.Person;
import com.soecode.lyf.service.PersonService;

@Service
public class PersonServiceImpl implements PersonService {

	private Logger logger = LoggerFactory.getLogger(this.getClass());

	// 注入Service依赖
	@Autowired
	private PersonDao personDao;

	@Override
	public Person queryByNamePwd(String name, String pwd) {
		List<Person> personList = personDao.queryByNamePwd(name, pwd);
		if (personList != null && personList.size() != 0) {
			return personList.get(0);
		}
		return null;
	}

}
